/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('umeng-finplus', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CancelComputeTaskByBcIdRequest {
  bcId?: long(name='bcId'),
}

model CancelComputeTaskByBcIdResponseBody = {
  code?: string(name='Code'),
  data?: boolean(name='Data'),
  msg?: string(name='Msg'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CancelComputeTaskByBcIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelComputeTaskByBcIdResponseBody(name='body'),
}

async function cancelComputeTaskByBcIdWithOptions(request: CancelComputeTaskByBcIdRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CancelComputeTaskByBcIdResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.bcId)) {
    query['bcId'] = request.bcId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CancelComputeTaskByBcId',
    version = '2021-11-30',
    protocol = 'HTTPS',
    pathname = `/batch_compute/cancelComputeTaskByBcId`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function cancelComputeTaskByBcId(request: CancelComputeTaskByBcIdRequest): CancelComputeTaskByBcIdResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return cancelComputeTaskByBcIdWithOptions(request, headers, runtime);
}

model CreateComputeTaskByDataSetIdRequest {
  batchInfoForm?: [ 
    {
      appId?: long(name='AppId'),
      cuVersions?: [ 
        {
          cuId?: string(name='CuId'),
          cuVersion?: string(name='CuVersion'),
        }
      ](name='CuVersions'),
    }
  ](name='BatchInfoForm'),
  datasetId?: long(name='DatasetId'),
  name?: string(name='Name'),
  remarks?: string(name='Remarks'),
}

model CreateComputeTaskByDataSetIdResponseBody = {
  code?: string(name='Code'),
  data?: [ long ](name='Data'),
  msg?: string(name='Msg'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateComputeTaskByDataSetIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateComputeTaskByDataSetIdResponseBody(name='body'),
}

async function createComputeTaskByDataSetIdWithOptions(request: CreateComputeTaskByDataSetIdRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateComputeTaskByDataSetIdResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.batchInfoForm)) {
    body['BatchInfoForm'] = request.batchInfoForm;
  }
  if (!Util.isUnset(request.datasetId)) {
    body['DatasetId'] = request.datasetId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.remarks)) {
    body['Remarks'] = request.remarks;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateComputeTaskByDataSetId',
    version = '2021-11-30',
    protocol = 'HTTPS',
    pathname = `/batch_compute/createComputeTaskByDataSetId`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createComputeTaskByDataSetId(request: CreateComputeTaskByDataSetIdRequest): CreateComputeTaskByDataSetIdResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createComputeTaskByDataSetIdWithOptions(request, headers, runtime);
}

model CreateComputeTaskByMultiDataSetIdRequest {
  appId?: long(name='appId'),
  dataSetIds?: string(name='dataSetIds'),
  name?: string(name='name'),
  remarks?: string(name='remarks'),
}

model CreateComputeTaskByMultiDataSetIdResponseBody = {
  code?: string(name='Code'),
  data?: long(name='Data'),
  msg?: string(name='Msg'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateComputeTaskByMultiDataSetIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateComputeTaskByMultiDataSetIdResponseBody(name='body'),
}

async function createComputeTaskByMultiDataSetIdWithOptions(request: CreateComputeTaskByMultiDataSetIdRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateComputeTaskByMultiDataSetIdResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['appId'] = request.appId;
  }
  if (!Util.isUnset(request.dataSetIds)) {
    body['dataSetIds'] = request.dataSetIds;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.remarks)) {
    body['remarks'] = request.remarks;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateComputeTaskByMultiDataSetId',
    version = '2021-11-30',
    protocol = 'HTTPS',
    pathname = `/batch_compute/createComputeTaskByMultiDataSetId`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createComputeTaskByMultiDataSetId(request: CreateComputeTaskByMultiDataSetIdRequest): CreateComputeTaskByMultiDataSetIdResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createComputeTaskByMultiDataSetIdWithOptions(request, headers, runtime);
}

model GetAvailableDataSetListResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      createTime?: string(name='createTime'),
      dataSetType?: int32(name='dataSetType'),
      datasetId?: long(name='datasetId'),
      idTypeDesc?: string(name='idTypeDesc'),
      name?: string(name='name'),
      statusDesc?: string(name='statusDesc'),
    }
  ](name='Data'),
  msg?: string(name='Msg'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model GetAvailableDataSetListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAvailableDataSetListResponseBody(name='body'),
}

async function getAvailableDataSetListWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): GetAvailableDataSetListResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetAvailableDataSetList',
    version = '2021-11-30',
    protocol = 'HTTPS',
    pathname = `/batch_compute/getAvailableDataSetList`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAvailableDataSetList(): GetAvailableDataSetListResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getAvailableDataSetListWithOptions(headers, runtime);
}

model GetComputeResultRequest {
  bcId?: long(name='bcId'),
}

model GetComputeResultResponseBody = {
  code?: string(name='Code'),
  data?: {
    bcId?: long(name='bcId'),
    billedNum?: long(name='billedNum'),
    code10000Num?: long(name='code10000Num'),
    code108Num?: long(name='code108Num'),
    code109Num?: long(name='code109Num'),
    exportFileName?: string(name='exportFileName'),
    fileLineNumber?: long(name='fileLineNumber'),
    name?: string(name='name'),
    password?: string(name='password'),
    state?: string(name='state'),
  }(name='Data'),
  msg?: string(name='Msg'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetComputeResultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetComputeResultResponseBody(name='body'),
}

async function getComputeResultWithOptions(request: GetComputeResultRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetComputeResultResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.bcId)) {
    query['bcId'] = request.bcId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetComputeResult',
    version = '2021-11-30',
    protocol = 'HTTPS',
    pathname = `/batch_compute/getComputeTaskResult`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getComputeResult(request: GetComputeResultRequest): GetComputeResultResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getComputeResultWithOptions(request, headers, runtime);
}

model GetDataSetStatusRequest {
  dataSetId?: long(name='dataSetId'),
}

model GetDataSetStatusResponseBody = {
  code?: string(name='Code'),
  data?: {
    createTime?: string(name='createTime'),
    dataSetType?: int32(name='dataSetType'),
    datasetId?: long(name='datasetId'),
    idTypeDesc?: string(name='idTypeDesc'),
    message?: string(name='message'),
    name?: string(name='name'),
    statusDesc?: string(name='statusDesc'),
  }(name='Data'),
  msg?: string(name='Msg'),
  success?: boolean(name='Success'),
  requestId?: string(name='requestId'),
}

model GetDataSetStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDataSetStatusResponseBody(name='body'),
}

async function getDataSetStatusWithOptions(request: GetDataSetStatusRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetDataSetStatusResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.dataSetId)) {
    query['dataSetId'] = request.dataSetId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDataSetStatus',
    version = '2021-11-30',
    protocol = 'HTTPS',
    pathname = `/batch_compute/getDataSetStatus`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getDataSetStatus(request: GetDataSetStatusRequest): GetDataSetStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getDataSetStatusWithOptions(request, headers, runtime);
}

model GetDataSetStsAKResponseBody = {
  code?: string(name='Code'),
  data?: {
    bucket?: string(name='Bucket'),
    endpoint?: string(name='Endpoint'),
    id?: string(name='Id'),
    path?: string(name='Path'),
    secret?: string(name='Secret'),
    token?: string(name='Token'),
  }(name='Data'),
  msg?: string(name='Msg'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetDataSetStsAKResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDataSetStsAKResponseBody(name='body'),
}

async function getDataSetStsAKWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): GetDataSetStsAKResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetDataSetStsAK',
    version = '2021-11-30',
    protocol = 'HTTPS',
    pathname = `/batch_compute/getDataSetStsAk`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getDataSetStsAK(): GetDataSetStsAKResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getDataSetStsAKWithOptions(headers, runtime);
}

model SubmitDataSetTaskRequest {
  dataSetType?: int32(name='dataSetType'),
  idType?: int32(name='idType'),
  name?: string(name='name'),
  ossFileName?: string(name='ossFileName'),
}

model SubmitDataSetTaskResponseBody = {
  code?: string(name='Code'),
  data?: long(name='Data'),
  msg?: string(name='Msg'),
  success?: boolean(name='Success'),
  requestId?: string(name='requestId'),
}

model SubmitDataSetTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitDataSetTaskResponseBody(name='body'),
}

async function submitDataSetTaskWithOptions(request: SubmitDataSetTaskRequest, headers: map[string]string, runtime: Util.RuntimeOptions): SubmitDataSetTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.dataSetType)) {
    body['dataSetType'] = request.dataSetType;
  }
  if (!Util.isUnset(request.idType)) {
    body['idType'] = request.idType;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.ossFileName)) {
    body['ossFileName'] = request.ossFileName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SubmitDataSetTask',
    version = '2021-11-30',
    protocol = 'HTTPS',
    pathname = `/batch_compute/submitDataSetTask`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitDataSetTask(request: SubmitDataSetTaskRequest): SubmitDataSetTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return submitDataSetTaskWithOptions(request, headers, runtime);
}

model CancelYydTaskByBcIdRequest {
  bcId?: long(name='bcId'),
}

model CancelYydTaskByBcIdResponseBody = {
  code?: string(name='Code'),
  data?: boolean(name='Data'),
  msg?: string(name='Msg'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CancelYydTaskByBcIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelYydTaskByBcIdResponseBody(name='body'),
}

async function cancelYydTaskByBcIdWithOptions(request: CancelYydTaskByBcIdRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CancelYydTaskByBcIdResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.bcId)) {
    query['bcId'] = request.bcId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'cancelYydTaskByBcId',
    version = '2021-11-30',
    protocol = 'HTTPS',
    pathname = `/batch_compute/yyd/task/cancel`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function cancelYydTaskByBcId(request: CancelYydTaskByBcIdRequest): CancelYydTaskByBcIdResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return cancelYydTaskByBcIdWithOptions(request, headers, runtime);
}

model CreateYydComputeTaskRequest {
  datasetId?: long(name='DatasetId'),
  name?: string(name='Name'),
  remarks?: string(name='Remarks'),
  appId?: long(name='appId'),
}

model CreateYydComputeTaskResponseBody = {
  code?: string(name='Code'),
  data?: long(name='Data'),
  msg?: string(name='Msg'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateYydComputeTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateYydComputeTaskResponseBody(name='body'),
}

async function createYydComputeTaskWithOptions(request: CreateYydComputeTaskRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateYydComputeTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.datasetId)) {
    body['DatasetId'] = request.datasetId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.remarks)) {
    body['Remarks'] = request.remarks;
  }
  if (!Util.isUnset(request.appId)) {
    body['appId'] = request.appId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'createYydComputeTask',
    version = '2021-11-30',
    protocol = 'HTTPS',
    pathname = `/batch_compute/yyd/task/create`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createYydComputeTask(request: CreateYydComputeTaskRequest): CreateYydComputeTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createYydComputeTaskWithOptions(request, headers, runtime);
}

model CreateYydDataSetRequest {
  name?: string(name='name'),
  ossFileName?: string(name='ossFileName'),
}

model CreateYydDataSetResponseBody = {
  code?: string(name='Code'),
  data?: long(name='Data'),
  msg?: string(name='Msg'),
  success?: boolean(name='Success'),
  requestId?: string(name='requestId'),
}

model CreateYydDataSetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateYydDataSetResponseBody(name='body'),
}

async function createYydDataSetWithOptions(request: CreateYydDataSetRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateYydDataSetResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.ossFileName)) {
    body['ossFileName'] = request.ossFileName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'createYydDataSet',
    version = '2021-11-30',
    protocol = 'HTTPS',
    pathname = `/batch_compute/yyd/dataset/create`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createYydDataSet(request: CreateYydDataSetRequest): CreateYydDataSetResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createYydDataSetWithOptions(request, headers, runtime);
}

model ListYydComputeTaskListResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      appId?: long(name='appId'),
      bcId?: long(name='bcId'),
      gmtCreate?: string(name='gmtCreate'),
      gmtModified?: string(name='gmtModified'),
      name?: string(name='name'),
      remarks?: string(name='remarks'),
      state?: string(name='state'),
    }
  ](name='Data'),
  msg?: string(name='Msg'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListYydComputeTaskListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListYydComputeTaskListResponseBody(name='body'),
}

async function listYydComputeTaskListWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): ListYydComputeTaskListResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'listYydComputeTaskList',
    version = '2021-11-30',
    protocol = 'HTTPS',
    pathname = `/batch_compute/yyd/task/list`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listYydComputeTaskList(): ListYydComputeTaskListResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listYydComputeTaskListWithOptions(headers, runtime);
}

model ListYydDataSetResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      createTime?: string(name='createTime'),
      dataSetType?: int32(name='dataSetType'),
      datasetId?: long(name='datasetId'),
      idTypeDesc?: string(name='idTypeDesc'),
      message?: string(name='message'),
      name?: string(name='name'),
      statusDesc?: string(name='statusDesc'),
    }
  ](name='Data'),
  msg?: string(name='Msg'),
  success?: boolean(name='Success'),
  requestId?: string(name='requestId'),
}

model ListYydDataSetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListYydDataSetResponseBody(name='body'),
}

async function listYydDataSetWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): ListYydDataSetResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'listYydDataSet',
    version = '2021-11-30',
    protocol = 'HTTPS',
    pathname = `/batch_compute/yyd/dataset/list`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listYydDataSet(): ListYydDataSetResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listYydDataSetWithOptions(headers, runtime);
}

